﻿<!doctype html>
<!--[if lt IE 7 ]> <html lang="en" class="ie6">    <![endif]-->
<!--[if IE 7 ]>    <html lang="en" class="ie7">    <![endif]-->
<!--[if IE 8 ]>    <html lang="en" class="ie8">    <![endif]-->
<!--[if IE 9 ]>    <html lang="en" class="ie9">    <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!--><html lang="en"><!--<![endif]-->
<head>
    <meta charset="utf-8">
    <title>苏州开心盒子</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <link rel="icon" href="http://cdn.console.aunbox.cn/favicon.ico" type="image/x-icon" />
    <link href="//cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
    <!--[if IE 9 ]>
    <style>
        @font-face {
            font-family: "iconfont";
            src: url("./iconfont.eot"); /* IE9 */
            font-style: normal;
            font-weight: normal;
        }
        #globalNav .iconfont {
            font-size: 18px;
        }
        .modal-header .close {
            position: absolute;
            right: 15px;
            top: 20px;
        }
    </style>
    <![endif]-->
    <script>
        window.globalConfig = {};
        window.globalConfig.constants = {};
        window.globalConfig.constant = function(key, value) {
            window.globalConfig.constants[key] = value;
            return this;
        };

        var fuckIE9 = false;
    </script>
    <!--[if IE 9 ]>
    <script>
        fuckIE9 = true;
    </script>
    <![endif]-->
</head>

<body>
    <script type="x-template" id="admin">
        <div>
            <div class="app-header navbar">
                <div class="navbar-header" :class="app.settings.navbarHeaderColor">
                    <button class="pull-right visible-xs dk" @click="toggleAppcollpase">
                        <i class="glyphicon glyphicon-cog"></i>
                    </button>
                    <button class="pull-right visible-xs" @click="toggleOffScreen">
                        <i class="glyphicon glyphicon-align-justify"></i>
                    </button>
                    <a href="#/" class="navbar-brand text-lt">
                        <img src="img/logo.png" alt="." style="display: inline-block"><span class="hidden-folded m-l-xs" v-html="app.name"></span>
                    </a>
                </div>
                <div class="collapse pos-rlt navbar-collapse box-shadow"
                     :class="app.settings.navbarCollapseColor"
                     ref="appcollpase">
                    <div class="nav navbar-nav hidden-xs">
                        <a href="" class="btn no-shadow navbar-btn ng-click-active" @click="tooggleAside">
                            <i class="fa fa-fw fa-dedent"></i>
                        </a>
                    </div>
                    <ul class="nav navbar-nav navbar-right">
                        <li class="dropdown hidden-sm" >
                            <a href class="dropdown-toggle" data-toggle="dropdown">
                                {{$i18n.locale}}<b class="caret"></b>
                            </a>
                            <!-- dropdown -->
                            <ul class="dropdown-menu animated fadeInRight w">
                                <li v-for="(lang,langkey) in rootcontroller.langs">
                                    <a @click="setGlobalLang(langkey, $event)" href="">{{langkey}}</a>
                                </li>
                            </ul>
                            <!-- / dropdown -->
                        </li>
                        <li class="hidden-xs">
                            <a @click="requestFullScreen($event)"><i class="glyphicon glyphicon-resize-full"></i></a>
                        </li>
                        <li class="dropdown">
                            <a href class="dropdown-toggle clear" ref="navbardropdown" data-toggle="dropdown">
                            <span class="thumb-sm avatar pull-right m-t-n-sm m-b-n-sm m-l-sm">
                                <img src="img/default-user.png" alt="...">
                                <i class="on md b-white bottom"></i>
                            </span>
                                <span class="hidden-xs" v-html="app.globalUserName"></span> <b class="caret"></b>
                            </a>
                            <ul class="dropdown-menu animated fadeInRight w">
                                <li>
                                    <a @click="loginout()">退出登录</a>
                                </li>
                            </ul>
                        </li>
                    </ul>
                </div>
            </div>
            <div class="app-aside hidden-xs" ref="appaside" :class="app.settings.asideColor">
                <div class="aside-wrap">
                    <div class="navi-wrap">
                        <div class="clearfix hidden-xs text-center hide" id="aside-user">
                            <div class="dropdown wrapper" uib-dropdown>
                                <a ui-sref="app.page.profile">
                        <span class="thumb-lg w-auto-folded avatar m-t-sm">
                            <img src="img/a0.jpg" class="img-full" alt="...">
                        </span>
                                </a>
                                <a href class="dropdown-toggle hidden-folded" uib-dropdown-toggle>
                            <span class="clear">
                                <span class="block m-t-sm">
                                <strong class="font-bold text-lt">John.Smith</strong>
                                <b class="caret"></b>
                                </span>
                                <span class="text-muted text-xs block">Art Director</span>
                            </span>
                                </a>
                                <ul class="dropdown-menu animated fadeInRight w hidden-folded">
                                    <li class="wrapper b-b m-b-sm bg-info m-t-n-xs">
                                        <span class="arrow top hidden-folded arrow-info"></span>
                                        <div>
                                            <p>300mb of 500mb used</p>
                                        </div>

                                    </li>
                                    <li>
                                        <a href>Settings</a>
                                    </li>
                                    <li>
                                        <a ui-sref="app.page.profile">Profile</a>
                                    </li>
                                    <li>
                                        <a href>
                                            <span class="badge bg-danger pull-right">3</span>
                                            Notifications
                                        </a>
                                    </li>
                                    <li class="divider"></li>
                                    <li>
                                        <a ui-sref="access.signin">Logout</a>
                                    </li>
                                </ul>
                            </div>
                            <div class="line dk hidden-folded"></div>
                        </div>

                        <nav class="navi">
                            <ul id="globalNav" class="nav">
                                <li class="hidden-folded padder m-t m-b-sm text-muted text-xs">
                                </li>
                                <li v-for="globalNav in globalroutenavs"
                                    :class="{active: checkRouteActive(globalNav.path, 'main')}"
        
                                    @click="onPageSelect"
                                >
                                    <router-link class="auto" :to="globalNav.path"
                                                 :title="globalNav.name"
                                                 data-placement="right"
                                                 aui-tooltip>
                                        <span v-html="globalNav.name"></span>
                                        <i class="globalicon" :class="globalNav.icon"></i>
                                    </router-link>
                                </li>
                                <li v-for="systemlink in systemlinks">
                                    <a class="auto" :href=" '//' + systemlink.system_url"
                                                 :title="systemlink.system_name"
                                                 data-placement="right"
                                                 aui-tooltip
                                                 target="_blank">
                                        <span v-html="systemlink.system_name"></span>
                                        <i class="globalicon" :class="systemlink.system_icon"></i>
                                    </a>
                                </li>
                            </ul>
                        </nav>                

                        <div class="wrapper m-t">
                        </div>
                    </div>
                </div>
            </div>
            <div class="app-content" ref="appcontent" :class="{'m-n': app.hideAside, 'h-full': app.hideFooter }">
                <div ui-butterbar></div>
                <div class="app-content-body app-content-full fade-in-up" :class="{'h-full': app.hideFooter }">
                    <!-- hbox layout -->
                    <div class="hbox hbox-auto-xs bg-light">
                        <!-- column -->
                        <div class="col w lter b-r bg-light dk">
                            <div class="vbox">
                                <div class="nav-tabs-alt">
                                    <ul class="nav nav-tabs nav-justified hide">
                                        <li ng-class="{'active': tabs[0]}">
                                            <a href ng-click="tab(0)">Day</a>
                                        </li>
                                    </ul>
                                </div>
                                <div class="row-row">
                                    <div class="cell-debug scrollable hover">
                                        <div class="cell-inner">
                                            <div class="tab-content">
                                                <div class="tab-pane active">
                                                    <div class="wrapper-md">
                                                        <ul class="nav nav-pills nav-stacked nav-sm">
                                                            <li v-for="subroute in subroutenavs"
                                                                :class="{active: checkRouteActive(subroute.path, 'sub') }"
                                                                v-if="subroute.name"
                                                                >
                                                                <router-link :to="subroute.to"><span v-html="subroute.name"></span></router-link>
                                                            </li>
                                                        </ul>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <!-- /column -->

                        <!-- column -->
                        <div class="col">
                            <div class="vbox">
                                <div class="row-row">
                                    <div class="cell-debug">
                                        <div class="cell-inner">
                                            <div class="wrapper-md">
                                                <router-view></router-view>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <!-- /column -->

                    </div>
                    <!-- /hbox layout -->
                </div>
            </div>
            <div class="app-footer navbar navbar-fixed-bottoçm bg-light lt b-t"
                 :class="{'m-n': app.hideAside, 'aui-hide': app.hideFooter}" >
            </div>
        </div>
</script>
    <div id="app" class="app app-header-fixed app-aside-fixed"
    :class="{'app-header-fixed':app.settings.headerFixed, 'app-aside-fixed':app.settings.asideFixed, 'app-aside-folded':app.settings.asideFolded, 'app-aside-dock':app.settings.asideDock, 'container':app.settings.container}">
        <router-view></router-view>
    </div>
    <!-- <script src="./polyfill.js"></script> -->
    <script src="//cdn.bootcss.com/es6-promise/4.1.1/es6-promise.auto.js"></script>
    <script src="//cdn.bootcss.com/jquery/1.12.3/jquery.min.js"></script>
    <script src="//cdn.bootcss.com/vue/2.3.4/vue.min.js"></script>
    <script src="//cdn.bootcss.com/vue-i18n/7.1.1/vue-i18n.min.js"></script>
    <script src="//cdn.bootcss.com/vue-router/2.7.0/vue-router.min.js"></script>
    <script src="//cdn.bootcss.com/axios/0.16.2/axios.min.js"></script>
    <script src="./config.js"></script>
    <!--[if IE 9 ]>
    <script src="./uploadify.js"></script>
    <script >

    </script>
    <![endif]-->
    <script>
    window.globalUploadifyPath = "../static/uploadify.swf";

    window.loadIndexReady = function () {
        window.AUI.Loader.loadStylesheet("ASYNCCSS");
        window.AUI.Loader.loadStylesheet("//cdn.bootcss.com/prism/9000.0.1/themes/prism.min.css");
        window.AUI.Loader.loadStylesheet("//cdn.bootcss.com/github-markdown-css/2.8.0/github-markdown.min.css");
        window.AUI.Loader.loadStylesheet("//cdn.bootcss.com/font-awesome/4.7.0/css/font-awesome.min.css");
        window.AUI.Loader.loadScripts(
            [
                'http://api.map.baidu.com/api?v=2.0&ak=3K4LGyRxytdEBnZmcwPbrtF5&callback=initMap',
                '//cdn.bootcss.com/echarts/3.6.2/echarts.min.js',
                '//cdn.bootcss.com/marked/0.3.6/marked.min.js',
                '//cdn.bootcss.com/jqueryui/1.10.4/jquery.ui.widget.min.js'
            ]
        ).catch(function (e) {
            console.log(e);
            console.log("echarts 类库加载失败");
        });

        window.createApp();
    };

</script>
<script>
    var SERVICE_WORKER_API = 'serviceWorker';
    var SERVICE_WORKER_FILE_PATH = 'aunbox-service-worker@{updateversion}.js';
    var isSupportServiceWorker = function () {
        return SERVICE_WORKER_API in navigator;
    };

    var sendMessageToSW = function (msg) {
        return new Promise(function (resolve, reject) {
            var messageChannel = new MessageChannel();
            messageChannel.port1.onmessage(function (message) {
                if (event.data.error) {
                    reject(event.data.error);
                } else {
                    resolve(event.data);
                }
            });

            navigator.serviceWorker.controller && navigator.serviceWorker.controller.postMessage(msg, [messageChannel.port2]);
        })
    };

    if (isSupportServiceWorker()) {
        navigator
            .serviceWorker
            .register(SERVICE_WORKER_FILE_PATH)
            .then(function(registration) {
                registration.update();
            })
            .catch(function () {
                console.error('Load service worker fail')
            })
    } else {
        console.info('Browser not support Service Worker.');
    }

    SOMETHING
</script>
</body>

</html>